package me.hl.proxy;

import org.junit.Test;

/**
 * Created by pulangke on 2017/2/10.
 */
public class ProxyTest {


    @Test
    public void testNumberProxy() throws Exception {
        Class[] interfaces = {MyOO.class};
        MyFilter[] myFilters = {new BigThanFiveFilter(), new BigThanOneFilter(), new BigThanTenFilter()};
        MyOO target = (MyOO) InvocationHandlerChain.invokeChain(myFilters, interfaces, MyNumber.class);
        target.setNumber(10);
        target.setNumber(5);
        target.setNumber(11);
    }
}
